package main

import "fmt"

func fool(a string, b int) int {
	fmt.Println("a = ", a)
	fmt.Println("b = ", b)

	c := 100

	return c
}

//匿名返回值
func fool2(a string, b int) (int, int) {
	fmt.Println("a = ", a)
	fmt.Println("b = ", b)

	c := 100
	d := 200
	return c, d
}

//返回值有形参名称
func fool3(a string, b int) (r1 int, r2 int) {
	fmt.Println("----foo3----")
	fmt.Println("a = ", a)
	fmt.Println("b = ", b)

	r1 = 1000
	r2 = 2000
	return
}

func main() {
	c := fool("abc", 199)
	fmt.Println("c = ", c)
	re1, re2 := fool2("haha", 999)
	fmt.Println("re1 = ", re1)
	fmt.Println("re2 = ", re2)

	res1, res2 := fool3("foo3", 333)
	fmt.Println("res1 = ", res1)
	fmt.Println("res2 = ", res2)
}
